export default function createFetch(url, method = 'GET', params = {}, config = {}) {
  return fetch(url, {
    method,
    data: JSON.stringify(params),
    headers: new Headers({
      'Content-Type': 'application/json'
    }),
    ...config
  })
}
